import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
import tailwindcss from "@tailwindcss/vite"

export default defineConfig({
  main: {
    plugins: [externalizeDepsPlugin()]
  },
  preload: {
    plugins: [externalizeDepsPlugin()]
  },
  renderer: {
    build: {
      target: 'esnext',
      rollupOptions: {
        input: {
          designer: resolve('src/renderer/designer.html'),
          recorder: resolve('src/renderer/recorder.html'),
        }
      }
    },
    resolve: {
      alias: {
        '@designer': resolve('src/renderer/src/pages/designer'),
        '@renderer': resolve('src/renderer/src')
      }
    },
    plugins: [react(), tailwindcss()]
  }
})
